<!DOCTYPE html>
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>快件e栈用户注册</title>
<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta content="telephone=no" name="format-detection">
<link href="css/style2.css" rel="stylesheet" type="text/css">
</head>
<body style="">
<section class="aui-flexView">
<header class="aui-navBar aui-navBar-fixed">
<a href="javascript:;" class="aui-navBar-item">
</a>
<div class="aui-center">
<span class="aui-center-title"></span>
</div>
</header>
<section class="aui-scrollView">
<div class="aui-ver-head">
<img src="images/head.png" alt="">
</div>
<div class="aui-ver-form"><img class="logo" src="images/logo.png">
<div class="aui-flex">
<div class="aui-flex-box">
<i class="icon icon-phone"></i>
<input id="phone1" type="text" autocomplete="off" placeholder="手机号码">
</div>
</div>
<div class="aui-flex">
<div class="aui-flex-box">
<i class="icon icon-code"></i>
<input id="code1" type="password" autocomplete="off" placeholder="密码">
</div>
</div>
 <div class="aui-flex-box">
<i class="icon icon-code"></i>
<input id="code2" type="password" autocomplete="off" placeholder="确认密码">
</div>

</div>
<div class="aui-ver-button">
<button id="register">用户注册</button>
</div>
<div class="aui-ver-button">
<button id="tologin">立即登录</button>
</div>
<div class="aui-cell-box">
<label class="cell-right">

</label>
</div>
</div>
</section>
</section>
<script src="js/jquery.min.js"></script>
<script src="/layer/layer.js"></script>

       <script type="text/javascript">
       /*注册*/
        $("#register").click(function () {
            var phoneReg = /(^1[3|4|5|7|8]\d{9}$)|(^09\d{8}$)/;
            var phone = $("#phone1").val();
            var p1 = $("#code1").val();
            var p2 = $("#code2").val();

            if (phone==""){
                layer.msg("用户电话号码不能为空",function () {});
                return;
            }else if (p1==""){
                layer.msg("密码不能为空",function () {});
                return;
            }else if (p2==""){
                layer.msg("请再次确认密码",function () {});
                return;
            }else if (p1!==p2){
                $("#code2").val("");
                $("#code2").attr('placeholder',"密码不一致");
            }else if (!phoneReg.test(phone)) {
                layer.msg("请输入有效的手机号码",function () { });
                return false;
            }else {
               $.post("/wx/register.do",{phone:phone,password:p2},function (data) {
                  var status = data.status;
                  if (status==0){
                   layer.msg(data.result);
                   $("#phone1").val("");
                   $("#code1").val("");
                   $("#code2").val("");
                  }else {
                    layer.msg(data.result);
                  }
               },"JSON");
            }
        });

        /*跳转登录*/
        $("#tologin").click(function () {
           window.location.href="login.html";
        })

       </script>

</body></html>